<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Entitas: Entitas.Context&lt; TEntity &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="docs-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Entitas
   &#160;<span id="projectnumber">1.13.0</span>
   </div>
   <div id="projectbrief">Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('class_entitas_1_1_context.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#properties">Properties</a> &#124;
<a href="#events">Events</a> &#124;
<a href="class_entitas_1_1_context-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Entitas.Context&lt; TEntity &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for Entitas.Context&lt; TEntity &gt;:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_entitas_1_1_context.png" usemap="#Entitas.Context_3C_20TEntity_20_3E_map" alt=""/>
  <map id="Entitas.Context_3C_20TEntity_20_3E_map" name="Entitas.Context_3C_20TEntity_20_3E_map">
<area href="interface_entitas_1_1_i_context.html" alt="Entitas.IContext&lt; TEntity &gt;" shape="rect" coords="0,0,160,24"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a87933d1337245e5a0ff28396f85d8de5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a87933d1337245e5a0ff28396f85d8de5">Context</a> (int <a class="el" href="class_entitas_1_1_context.html#a49fba33ba0488022060671ef79c86be3">totalComponents</a>, Func&lt; TEntity &gt; entityFactory)</td></tr>
<tr class="separator:a87933d1337245e5a0ff28396f85d8de5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb7b862ad57b7cfe37ae3abd2e4223ac"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#abb7b862ad57b7cfe37ae3abd2e4223ac">Context</a> (int <a class="el" href="class_entitas_1_1_context.html#a49fba33ba0488022060671ef79c86be3">totalComponents</a>, int startCreationIndex, <a class="el" href="class_entitas_1_1_context_info.html">ContextInfo</a> <a class="el" href="class_entitas_1_1_context.html#abdde35988b55cdbc905ba9b50326ed70">contextInfo</a>, Func&lt; <a class="el" href="interface_entitas_1_1_i_entity.html">IEntity</a>, <a class="el" href="interface_entitas_1_1_i_a_e_r_c.html">IAERC</a> &gt; aercFactory, Func&lt; TEntity &gt; entityFactory)</td></tr>
<tr class="separator:abb7b862ad57b7cfe37ae3abd2e4223ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad78318367db3cdeb5ccf9470a1916d71"><td class="memItemLeft" align="right" valign="top">TEntity&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#ad78318367db3cdeb5ccf9470a1916d71">CreateEntity</a> ()</td></tr>
<tr class="separator:ad78318367db3cdeb5ccf9470a1916d71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e2997c233e248d860cc85f33aa596af"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a6e2997c233e248d860cc85f33aa596af">DestroyAllEntities</a> ()</td></tr>
<tr class="separator:a6e2997c233e248d860cc85f33aa596af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8dc55cc92fb7b80aaf48d18ed48346e6"><td class="memItemLeft" align="right" valign="top"><a id="a8dc55cc92fb7b80aaf48d18ed48346e6"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a8dc55cc92fb7b80aaf48d18ed48346e6">HasEntity</a> (TEntity entity)</td></tr>
<tr class="memdesc:a8dc55cc92fb7b80aaf48d18ed48346e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines whether the context has the specified entity. <br /></td></tr>
<tr class="separator:a8dc55cc92fb7b80aaf48d18ed48346e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ec3a1e5b8e186d2dec13ebed26d2dcc"><td class="memItemLeft" align="right" valign="top"><a id="a7ec3a1e5b8e186d2dec13ebed26d2dcc"></a>
TEntity []&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a7ec3a1e5b8e186d2dec13ebed26d2dcc">GetEntities</a> ()</td></tr>
<tr class="memdesc:a7ec3a1e5b8e186d2dec13ebed26d2dcc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns all entities which are currently in the context. <br /></td></tr>
<tr class="separator:a7ec3a1e5b8e186d2dec13ebed26d2dcc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5395e55b7d034cb6e33a86f4f73104c4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="interface_entitas_1_1_i_group.html">IGroup</a>&lt; TEntity &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a5395e55b7d034cb6e33a86f4f73104c4">GetGroup</a> (<a class="el" href="interface_entitas_1_1_i_matcher.html">IMatcher</a>&lt; TEntity &gt; matcher)</td></tr>
<tr class="separator:a5395e55b7d034cb6e33a86f4f73104c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9921fe1978e800bb692d0c429d51e485"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a9921fe1978e800bb692d0c429d51e485">AddEntityIndex</a> (<a class="el" href="interface_entitas_1_1_i_entity_index.html">IEntityIndex</a> entityIndex)</td></tr>
<tr class="separator:a9921fe1978e800bb692d0c429d51e485"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a596fdd33a0be12f534af444f4b36e076"><td class="memItemLeft" align="right" valign="top"><a id="a596fdd33a0be12f534af444f4b36e076"></a>
<a class="el" href="interface_entitas_1_1_i_entity_index.html">IEntityIndex</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a596fdd33a0be12f534af444f4b36e076">GetEntityIndex</a> (string name)</td></tr>
<tr class="memdesc:a596fdd33a0be12f534af444f4b36e076"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the <a class="el" href="interface_entitas_1_1_i_entity_index.html">IEntityIndex</a> for the specified name. <br /></td></tr>
<tr class="separator:a596fdd33a0be12f534af444f4b36e076"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac065a992fc8f1d8609f1400bde1b1e8c"><td class="memItemLeft" align="right" valign="top"><a id="ac065a992fc8f1d8609f1400bde1b1e8c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#ac065a992fc8f1d8609f1400bde1b1e8c">ResetCreationIndex</a> ()</td></tr>
<tr class="memdesc:ac065a992fc8f1d8609f1400bde1b1e8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resets the creationIndex back to 0. <br /></td></tr>
<tr class="separator:ac065a992fc8f1d8609f1400bde1b1e8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a65f75d0b04e3b03b6965fb70a6aae9de"><td class="memItemLeft" align="right" valign="top"><a id="a65f75d0b04e3b03b6965fb70a6aae9de"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a65f75d0b04e3b03b6965fb70a6aae9de">ClearComponentPool</a> (int index)</td></tr>
<tr class="memdesc:a65f75d0b04e3b03b6965fb70a6aae9de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the componentPool at the specified index. <br /></td></tr>
<tr class="separator:a65f75d0b04e3b03b6965fb70a6aae9de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d328db5cc7eea11a02a3e9bdc86a412"><td class="memItemLeft" align="right" valign="top"><a id="a5d328db5cc7eea11a02a3e9bdc86a412"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a5d328db5cc7eea11a02a3e9bdc86a412">ClearComponentPools</a> ()</td></tr>
<tr class="memdesc:a5d328db5cc7eea11a02a3e9bdc86a412"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears all componentPools. <br /></td></tr>
<tr class="separator:a5d328db5cc7eea11a02a3e9bdc86a412"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60f65a4d43272c707911f90705d58c32"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a60f65a4d43272c707911f90705d58c32">Reset</a> ()</td></tr>
<tr class="separator:a60f65a4d43272c707911f90705d58c32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acca3015253954ec2e2878bdb20402eb0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#acca3015253954ec2e2878bdb20402eb0">RemoveAllEventHandlers</a> ()</td></tr>
<tr class="separator:acca3015253954ec2e2878bdb20402eb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4ee1909178ab3f426810e08ea9178ee"><td class="memItemLeft" align="right" valign="top"><a id="ae4ee1909178ab3f426810e08ea9178ee"></a>
override string&#160;</td><td class="memItemRight" valign="bottom"><b>ToString</b> ()</td></tr>
<tr class="separator:ae4ee1909178ab3f426810e08ea9178ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="properties"></a>
Properties</h2></td></tr>
<tr class="memitem:a49fba33ba0488022060671ef79c86be3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a49fba33ba0488022060671ef79c86be3">totalComponents</a><code> [get]</code></td></tr>
<tr class="separator:a49fba33ba0488022060671ef79c86be3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc611e7de6414b1aafb06e22822b8316"><td class="memItemLeft" align="right" valign="top">Stack&lt; <a class="el" href="interface_entitas_1_1_i_component.html">IComponent</a> &gt; []&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#acc611e7de6414b1aafb06e22822b8316">componentPools</a><code> [get]</code></td></tr>
<tr class="separator:acc611e7de6414b1aafb06e22822b8316"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abdde35988b55cdbc905ba9b50326ed70"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_entitas_1_1_context_info.html">ContextInfo</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#abdde35988b55cdbc905ba9b50326ed70">contextInfo</a><code> [get]</code></td></tr>
<tr class="separator:abdde35988b55cdbc905ba9b50326ed70"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a318056a17297c9c7f645ee1177c00243"><td class="memItemLeft" align="right" valign="top"><a id="a318056a17297c9c7f645ee1177c00243"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a318056a17297c9c7f645ee1177c00243">count</a><code> [get]</code></td></tr>
<tr class="memdesc:a318056a17297c9c7f645ee1177c00243"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of entities in the context. <br /></td></tr>
<tr class="separator:a318056a17297c9c7f645ee1177c00243"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a08377b0def691faa04462f19e68fa3cc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a08377b0def691faa04462f19e68fa3cc">reusableEntitiesCount</a><code> [get]</code></td></tr>
<tr class="separator:a08377b0def691faa04462f19e68fa3cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a79d557c321f3e11ba8224a74873723f8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a79d557c321f3e11ba8224a74873723f8">retainedEntitiesCount</a><code> [get]</code></td></tr>
<tr class="separator:a79d557c321f3e11ba8224a74873723f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="events"></a>
Events</h2></td></tr>
<tr class="memitem:a2067db8aecab163ca35539554e9a78df"><td class="memItemLeft" align="right" valign="top"><a id="a2067db8aecab163ca35539554e9a78df"></a>
ContextEntityChanged&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a2067db8aecab163ca35539554e9a78df">OnEntityCreated</a></td></tr>
<tr class="memdesc:a2067db8aecab163ca35539554e9a78df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Occurs when an entity gets created. <br /></td></tr>
<tr class="separator:a2067db8aecab163ca35539554e9a78df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab8c74cb2adee934df32ec2a86fc607b2"><td class="memItemLeft" align="right" valign="top"><a id="ab8c74cb2adee934df32ec2a86fc607b2"></a>
ContextEntityChanged&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#ab8c74cb2adee934df32ec2a86fc607b2">OnEntityWillBeDestroyed</a></td></tr>
<tr class="memdesc:ab8c74cb2adee934df32ec2a86fc607b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Occurs when an entity will be destroyed. <br /></td></tr>
<tr class="separator:ab8c74cb2adee934df32ec2a86fc607b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a315b3628dc474c021d8eb6df3c514285"><td class="memItemLeft" align="right" valign="top"><a id="a315b3628dc474c021d8eb6df3c514285"></a>
ContextEntityChanged&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#a315b3628dc474c021d8eb6df3c514285">OnEntityDestroyed</a></td></tr>
<tr class="memdesc:a315b3628dc474c021d8eb6df3c514285"><td class="mdescLeft">&#160;</td><td class="mdescRight">Occurs when an entity got destroyed. <br /></td></tr>
<tr class="separator:a315b3628dc474c021d8eb6df3c514285"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af08af71f91b512aee430ab4091709e3e"><td class="memItemLeft" align="right" valign="top"><a id="af08af71f91b512aee430ab4091709e3e"></a>
ContextGroupChanged&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_entitas_1_1_context.html#af08af71f91b512aee430ab4091709e3e">OnGroupCreated</a></td></tr>
<tr class="memdesc:af08af71f91b512aee430ab4091709e3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Occurs when a group gets created for the first time. <br /></td></tr>
<tr class="separator:af08af71f91b512aee430ab4091709e3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A context manages the lifecycle of entities and groups. You can create and destroy entities and get groups of entities. The prefered way to create a context is to use the generated methods from the code generator, e.g. var context = new GameContext(); </p>
<div class="typeconstraint">
<dl><dt><b>Type Constraints</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em>TEntity</em></td><td>&#160;:</td><td valign="top"><em>class</em></td><td>&#160;</td></tr>
<tr><td valign="top"><em>TEntity</em></td><td>&#160;:</td><td valign="top"><em><a class="el" href="interface_entitas_1_1_i_entity.html">IEntity</a></em></td><td>&#160;</td></tr>
</table>
</dd>
</dl>
</div>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00012">12</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a87933d1337245e5a0ff28396f85d8de5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a87933d1337245e5a0ff28396f85d8de5">&#9670;&nbsp;</a></span>Context() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_entitas_1_1_context.html">Entitas.Context</a>&lt; TEntity &gt;.<a class="el" href="class_entitas_1_1_context.html">Context</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>totalComponents</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Func&lt; TEntity &gt;&#160;</td>
          <td class="paramname"><em>entityFactory</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>The prefered way to create a context is to use the generated methods from the code generator, e.g. var context = new GameContext(); </p>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00082">82</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>

</div>
</div>
<a id="abb7b862ad57b7cfe37ae3abd2e4223ac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abb7b862ad57b7cfe37ae3abd2e4223ac">&#9670;&nbsp;</a></span>Context() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_entitas_1_1_context.html">Entitas.Context</a>&lt; TEntity &gt;.<a class="el" href="class_entitas_1_1_context.html">Context</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>totalComponents</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>startCreationIndex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_entitas_1_1_context_info.html">ContextInfo</a>&#160;</td>
          <td class="paramname"><em>contextInfo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Func&lt; <a class="el" href="interface_entitas_1_1_i_entity.html">IEntity</a>, <a class="el" href="interface_entitas_1_1_i_a_e_r_c.html">IAERC</a> &gt;&#160;</td>
          <td class="paramname"><em>aercFactory</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Func&lt; TEntity &gt;&#160;</td>
          <td class="paramname"><em>entityFactory</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>The prefered way to create a context is to use the generated methods from the code generator, e.g. var context = new GameContext(); </p>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00087">87</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a9921fe1978e800bb692d0c429d51e485"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9921fe1978e800bb692d0c429d51e485">&#9670;&nbsp;</a></span>AddEntityIndex()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_entitas_1_1_context.html">Entitas.Context</a>&lt; TEntity &gt;.AddEntityIndex </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="interface_entitas_1_1_i_entity_index.html">IEntityIndex</a>&#160;</td>
          <td class="paramname"><em>entityIndex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Adds the <a class="el" href="interface_entitas_1_1_i_entity_index.html">IEntityIndex</a> for the specified name. There can only be one <a class="el" href="interface_entitas_1_1_i_entity_index.html">IEntityIndex</a> per name. </p>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00221">221</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>

</div>
</div>
<a id="ad78318367db3cdeb5ccf9470a1916d71"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad78318367db3cdeb5ccf9470a1916d71">&#9670;&nbsp;</a></span>CreateEntity()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">TEntity <a class="el" href="class_entitas_1_1_context.html">Entitas.Context</a>&lt; TEntity &gt;.CreateEntity </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Creates a new entity or gets a reusable entity from the internal ObjectPool for entities. </p>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00130">130</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>

</div>
</div>
<a id="a6e2997c233e248d860cc85f33aa596af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e2997c233e248d860cc85f33aa596af">&#9670;&nbsp;</a></span>DestroyAllEntities()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_entitas_1_1_context.html">Entitas.Context</a>&lt; TEntity &gt;.DestroyAllEntities </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Destroys all entities in the context. Throws an exception if there are still retained entities. </p>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00160">160</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>

</div>
</div>
<a id="a5395e55b7d034cb6e33a86f4f73104c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5395e55b7d034cb6e33a86f4f73104c4">&#9670;&nbsp;</a></span>GetGroup()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="interface_entitas_1_1_i_group.html">IGroup</a>&lt;TEntity&gt; <a class="el" href="class_entitas_1_1_context.html">Entitas.Context</a>&lt; TEntity &gt;.GetGroup </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="interface_entitas_1_1_i_matcher.html">IMatcher</a>&lt; TEntity &gt;&#160;</td>
          <td class="paramname"><em>matcher</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns a group for the specified matcher. Calling context.GetGroup(matcher) with the same matcher will always return the same instance of the group. </p>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00191">191</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>

</div>
</div>
<a id="acca3015253954ec2e2878bdb20402eb0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acca3015253954ec2e2878bdb20402eb0">&#9670;&nbsp;</a></span>RemoveAllEventHandlers()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_entitas_1_1_context.html">Entitas.Context</a>&lt; TEntity &gt;.RemoveAllEventHandlers </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Removes all event handlers OnEntityCreated, OnEntityWillBeDestroyed, OnEntityDestroyed and OnGroupCreated </p>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00269">269</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>

</div>
</div>
<a id="a60f65a4d43272c707911f90705d58c32"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a60f65a4d43272c707911f90705d58c32">&#9670;&nbsp;</a></span>Reset()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_entitas_1_1_context.html">Entitas.Context</a>&lt; TEntity &gt;.Reset </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Resets the context (destroys all entities and resets creationIndex back to 0). </p>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00261">261</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>

</div>
</div>
<h2 class="groupheader">Property Documentation</h2>
<a id="acc611e7de6414b1aafb06e22822b8316"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acc611e7de6414b1aafb06e22822b8316">&#9670;&nbsp;</a></span>componentPools</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Stack&lt;<a class="el" href="interface_entitas_1_1_i_component.html">IComponent</a>&gt; [] <a class="el" href="class_entitas_1_1_context.html">Entitas.Context</a>&lt; TEntity &gt;.componentPools</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns all componentPools. componentPools is used to reuse removed components. Removed components will be pushed to the componentPool. Use entity.CreateComponent(index, type) to get a new or reusable component from the componentPool. </p>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00036">36</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>

</div>
</div>
<a id="abdde35988b55cdbc905ba9b50326ed70"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abdde35988b55cdbc905ba9b50326ed70">&#9670;&nbsp;</a></span>contextInfo</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_entitas_1_1_context_info.html">ContextInfo</a> <a class="el" href="class_entitas_1_1_context.html">Entitas.Context</a>&lt; TEntity &gt;.contextInfo</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>The contextInfo contains information about the context. It's used to provide better error messages. </p>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00040">40</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>

</div>
</div>
<a id="a79d557c321f3e11ba8224a74873723f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a79d557c321f3e11ba8224a74873723f8">&#9670;&nbsp;</a></span>retainedEntitiesCount</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_entitas_1_1_context.html">Entitas.Context</a>&lt; TEntity &gt;.retainedEntitiesCount</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns the number of entities that are currently retained by other objects (e.g. <a class="el" href="class_entitas_1_1_group.html">Group</a>, <a class="el" href="class_entitas_1_1_collector.html">Collector</a>, <a class="el" href="class_entitas_1_1_reactive_system.html">ReactiveSystem</a>). </p>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00051">51</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>

</div>
</div>
<a id="a08377b0def691faa04462f19e68fa3cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a08377b0def691faa04462f19e68fa3cc">&#9670;&nbsp;</a></span>reusableEntitiesCount</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_entitas_1_1_context.html">Entitas.Context</a>&lt; TEntity &gt;.reusableEntitiesCount</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns the number of entities in the internal ObjectPool for entities which can be reused. </p>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00047">47</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>

</div>
</div>
<a id="a49fba33ba0488022060671ef79c86be3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a49fba33ba0488022060671ef79c86be3">&#9670;&nbsp;</a></span>totalComponents</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_entitas_1_1_context.html">Entitas.Context</a>&lt; TEntity &gt;.totalComponents</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>The total amount of components an entity can possibly have. This value is generated by the code generator, e.g ComponentLookup.TotalComponents. </p>

<p class="definition">Definition at line <a class="el" href="_context_8cs_source.html#l00029">29</a> of file <a class="el" href="_context_8cs_source.html">Context.cs</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>Entitas/Entitas/Context/<a class="el" href="_context_8cs_source.html">Context.cs</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_entitas.html">Entitas</a></li><li class="navelem"><a class="el" href="class_entitas_1_1_context.html">Context</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
